package cn.edu.scau.nursingcenter.dao;

import org.apache.ibatis.annotations.Param;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;
import org.springframework.stereotype.Repository;

import cn.edu.scau.nursingcenter.entiry.Admin;
/**
 * 管理员DAO接口AdminRepository
 * @author feng
 *
 */
@Repository
public interface AdminRepository extends JpaRepository<Admin, Integer>{

	/**
	  * 管理员登录
	 * @param name 名字
	 * @param password 面膜
	 * @return 管理员对象
	 */
	@Query(value = "from admin a where a.admin_name=?1 and a.admin_password=?2")
	Admin login(@Param("admin_name")String name,@Param("admin_password")String password);
}
